<!DOCTYPE html>
<html lang="en">

<head>
  @@include('./meta.html',{})
</head>

<body class="app-component">
  @@include('./header.html',{
  "components": "active"
  })
  <div class="component-wrapper">
    <div class="component-navleft">
      @@include('./navleft.html',{
      "tab_element": "active"
      })
    </div><!-- component-navleft -->

    <div class="component-sidebar">
      @@include('./sidebar.html',{
      "tab_element": "active",
      "offcanvas": "active",
      "urlPrefix": "."
      })
    </div><!-- component-sidebar -->

      <div class="component-content">
        <div class="component-content-header">
          <nav aria-label="breadcrumb">
            <ol class="breadcrumb breadcrumb-style1 mg-b-0">
              <li class="breadcrumb-item"><a href="#">Components</a></li>
              <li class="breadcrumb-item"><a href="#">UI Elements</a></li>
              <li class="breadcrumb-item active" aria-current="page">Off-Canvas</li>
            </ol>
          </nav>
          <a href="javascript:;" id="componentOptions" class="text-secondary mg-l-auto d-xl-none"><i data-feather="more-horizontal"></i></a>
        </div><!-- component-content-header -->

        <div class="component-content-body" data-spy="scroll" data-target="#navSection" data-offset="120">
          <div class="content content-components">
            <div class="container">
              <!--sd-->
              <h1 class="td-title">Off-Canvas</h1>
          <p class="td-lead">Documentation and examples of off-canvas sidebar that slides in and out of the screen, which is mostly used as mobile navigations.</p>

          <hr class="mg-y-40">

          <h4 id="section1" class="mg-b-10">Basic Example</h4>
          <p class="mg-b-30">You can put any element to off-canvas sidebar like in the example below.</p>

          <div data-label="Example" class="td-example">
            <a href="#offCanvas1" class="btn btn-secondary off-canvas-menu mn-ht-0">Show Sidebar</a>
          </div><!-- td-example -->
          <pre><code class="language-html">&lt;div class=&quot;off-canvas&quot;&gt;
  &lt;!-- any content goes here --&gt;
&lt;/div&gt;
&lt;div class=&quot;off-canvas-pusher&quot;&gt;
  &lt;a href="#offCanvasMenu" class="btn btn-secondary off-canvas-menu"&gt;Menu&lt;/a&gt;
&lt;/div&gt;</code></pre>
          <pre><code class="language-js">$('.off-canvas-menu').on('click', function(e){
  e.preventDefault();
  var target = $(this).attr('href');
  $(target).addClass('show');
});</code></pre>

          <hr class="mg-y-40">

          <h4 id="section2" class="mg-b-10">With Overlay</h4>
          <p class="mg-b-30">You can enable overlay by adding class <code>.off-canvas-overlay</code> to <code>.off-canvas</code>.</p>

          <div data-label="Example" class="td-example">
            <a href="#offCanvas2" class="btn btn-secondary mn-ht-0 off-canvas-menu">Show Sidebar</a>
          </div><!-- td-example -->
          <pre><code class="language-html">&lt;div class=&quot;off-canvas off-canvas-overlay&quot;&gt;
  &lt;!-- any content goes here --&gt;
&lt;/div&gt;</code></pre>

          <hr class="mg-y-40">

          <h4 id="section3" class="mg-b-10">Flip to Right</h4>
          <p class="mg-b-30">You can flip the sidebar to display in right instead of left by adding class <code>.off-canvas-right</code> to <code>.off-canvas</code>.</p>

          <div data-label="Example" class="td-example">
            <a href="#offCanvas3" class="btn btn-secondary mn-ht-0 off-canvas-menu">Show Sidebar</a>
          </div><!-- td-example -->
          <pre><code class="language-html">&lt;div class=&quot;off-canvas off-canvas-overlay off-canvas-right&quot;&gt;
  &lt;!-- any content goes here --&gt;
&lt;/div&gt;</code></pre>

          <hr class="mg-y-40">

          <h5 id="section4" class="mg-b-10">Nav in Off-Canvas</h5>
          <p class="mg-b-30">An off-canvas can have a navigation added.</p>

          <div data-label="Example" class="td-example">
            <a href="#offCanvas4" class="btn btn-secondary mn-ht-0 off-canvas-menu">Show Sidebar</a>
          </div><!-- td-example -->
          <pre><code class="language-html">&lt;div class=&quot;off-canvas off-canvas-overlay&quot;&gt;
  &lt;div class=&quot;off-canvas-header&quot;&gt;...&lt;/div&gt;
  &lt;div class=&quot;off-canvas-body&quot;&gt;
    &lt;ul class=&quot;nav sidebar-nav&quot;&gt;...&lt;/ul&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>

          <hr class="mg-y-40">

          <h5 id="section5" class="mg-b-10">Color &amp; Background</h5>
          <p class="mg-b-30">An off-canvas can have a different background and color by adding some classes.</p>

          <div data-label="Example" class="td-example">
            <a href="#offCanvas5" class="btn btn-primary mn-ht-0 off-canvas-menu is-overlay is-dark" data-color="primary">Primary</a>
            <a href="#offCanvas6" class="btn btn-secondary mn-ht-0 off-canvas-menu is-overlay is-dark" data-color="secondary">Secondary</a>
            <a href="#offCanvas7" class="btn btn-dark mn-ht-0 off-canvas-menu is-overlay is-dark">Dark</a>
          </div><!-- td-example -->
          <pre><code class="language-html">&lt;div class=&quot;off-canvas off-canvas-overlay off-canvas-dark bg-primary&quot;&gt;...&lt;/div&gt;
&lt;div class=&quot;off-canvas off-canvas-overlay off-canvas-dark bg-secondary&quot;&gt;...&lt;/div&gt;
&lt;div class=&quot;off-canvas off-canvas-overlay off-canvas-dark&quot;&gt;...&lt;/div&gt;</code></pre>

          <hr class="mg-y-40">

          <h4 id="section6" class="mg-b-10">Transition Effect</h4>
          <p class="mg-b-30">An off-canvas can change to different transition effect.</p>

          <div data-label="Example" class="td-example">
            <a href="#offCanvas8" class="btn btn-secondary mn-ht-0 off-canvas-menu is-overlay is-dark">Slide In Left</a>
            <a href="#offCanvas9" class="btn btn-secondary mn-ht-0 off-canvas-menu is-overlay is-dark">Reveal</a>
            <a href="#offCanvas10" class="btn btn-secondary mn-ht-0 off-canvas-menu is-overlay is-dark">Push</a>
          </div><!-- td-example -->
          <pre><code class="language-html">&lt;div class=&quot;off-canvas&quot;&gt;...&lt;/div&gt;
&lt;div class=&quot;off-canvas off-canvas-reveal&quot;&gt;...&lt;/div&gt;
&lt;div class=&quot;off-canvas off-canvas-push&quot;&gt;...&lt;/div&gt;</code></pre>

@@include('./footer.html',{})

            </div>
          </div>
        </div><!-- component-content-body -->

        <div class="component-content-sidebar section-nav">
          <label class="tx-10 tx-medium tx-spacing-1 tx-color-03 tx-uppercase tx-sans mg-b-15">On This Page</label>
          <nav id="navSection" class="nav flex-column">
            <a href="#section1" class="nav-link">Basic Example</a>
            <a href="#section2" class="nav-link">With Overlay</a>
            <a href="#section3" class="nav-link">Flip to Right</a>
            <a href="#section4" class="nav-link">Nav in Off-Canvas</a>
            <a href="#section5" class="nav-link">Color &amp; Background</a>
            <a href="#section6" class="nav-link">Transition Effect</a>
          </nav>
        </div><!-- component-content-sidebar -->
      </div><!-- component-content -->

    </div><!-- component-wrapper -->

  </div>
  @@include('./_script.html',{})

    <script>
      $(function(){
        'use strict'
 
        $('.off-canvas-menu').on('click', function(e){
          e.preventDefault();
          var target = $(this).attr('href');
          $(target).addClass('show');
        });


        $('.off-canvas .close').on('click', function(e){
          e.preventDefault();
          $(this).closest('.off-canvas').removeClass('show');
        })

        $(document).on('click touchstart', function(e){
          e.stopPropagation();

          // closing of sidebar menu when clicking outside of it
          if(!$(e.target).closest('.off-canvas-menu').length) {
            var offCanvas = $(e.target).closest('.off-canvas').length;
            if(!offCanvas) {
              $('.off-canvas.show').removeClass('show');
            }
          }
        });
      });
    </script>
  </body>
</html>
